<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!-- Framework CSS -->
<link rel="stylesheet" href="${reqpath }${base }/content/themes/${site.theme }/blueprint/screen.css" type="text/css" media="screen, projection">
<link rel="stylesheet" href="${reqpath }${base }/content/themes/${site.theme }/blueprint/print.css" type="text/css" media="print">
<!--[if lt IE 8]><link rel="stylesheet" href="${base}/content/themes/${site.theme }/blueprint/ie.css" type="text/css" media="screen, projection"><![endif]-->
<!-- Import fancy-type plugin for the sample page. -->
<link rel="stylesheet" href="${reqpath }${base }/content/themes/${site.theme }/blueprint/plugins/fancy-type/screen.css" type="text/css" media="screen, projection">
<link rel="stylesheet" href="${reqpath }${base }/content/themes/${site.theme }/style.css" type="text/css" media="all" />
<link rel="alternate" type="application/rss+xml" title="${site.name } RSS Feed" href="${reqpath }${base }/?feed=rss2" />
<link rel="alternate" type="application/atom+xml" title="${site.name } Atom Feed" href="${reqpath }${base }/?feed=atom" />
<link rel="pingback" href="${reqpath }${base }/xmlrpc" />
<link rel="shortcut icon" href="${reqpath }${base }/content/themes/${site.theme }/favicon.ico" type="image/x-icon" />
<script type="text/javascript" src="${reqpath }${base}/content/js/jquery-1.4.3.min.js"></script>
<link rel='index' title='${site.name }' href='${site.url }' />
<meta name="generator" content="NutzQuickStart" />
<script type="text/javascript">
	var appBase = "${base}";
	$(function() {
		<c:if test="${not empty sessionScope['cn.feichanghao.nutz.quickstart.auth.model.User']}">
		$('#loginForm').hide();
		$('#logout').show();
		</c:if>
		
		$('#loginForm').submit(
				function() {
					$.post(appBase + "/auth/login", $(this).serialize(),
							function(result) {
								if (result == true) {
									alert("${sessionScope['cn.feichanghao.nutz.quickstart.auth.model.User'].username}${msg['auth.login.success']}");
									$('#loginForm').hide();
									$('#logout').show();
								} else {
									alert("${msg['auth.login.fail']}");
								}
							}, "json");
					return false;
				});
		$('#logout').click(function() {
			$.post(appBase + "/auth/logout", function() {
				alert("${msg['auth.logout.success']}");
				$('#loginForm').show();
				$('#logout').hide();
			});
		});
	});
</script>